<template>
  <div>
    <div class="info">
      <div class="user">
        <Avatar :src="detailData.userInfo.profilePhotoPath" size="large" style="margin: 0 auto;"/>
        <p style="text-align: center;">{{ detailData.userInfo.nickname }}</p>
      </div>
      <div class="shipping">
        <ul>
          <li>收货人：{{ detailData.completeInfoVO.consigneePhone }} {{ detailData.completeInfoVO.consigneeName }}</li>
          <li>收货地址：{{ detailData.completeInfoVO.consigneeAddress }}</li>
          <li>下单时间：{{ detailData.completeInfoVO.gmtModified | format }}</li>
          <li>发货地址：</li>
        </ul>
      </div>
    </div>
    <div class="remark">
      买家留言：{{ detailData.completeInfoVO.remark }}
    </div>
    <div class="items">
      <h3>订单项</h3>
      <ul>
        <li v-for="(item, index) in detailData.itemVOList" :key="index">
          <div class="goods_img">
            <img :src="item.goodsImagePath" alt="图片" width="100%">
          </div>
          <div class="goods_info">
            <ul>
              <li>名称：{{ item.goodsTitle }}</li>
              <li>单价：{{ item.goodsDiscountPrice / 100 }}￥</li>
              <li style="border-bottom: none;">数量：{{ item.purchaseQuantity }} <span style="float: right;">总价：{{ item.goodsDiscountTotal / 100 }}￥</span></li>
            </ul>
          </div>
        </li>
        <li class="count">
          <p>订单总价：{{ detailData.completeInfoVO.orderDiscountTotal / 100 }}￥</p>
          <p>运费：{{ detailData.completeInfoVO.freight / 100 }}￥</p>
          <p>合计：{{ detailData.completeInfoVO.orderActualPayment / 100 }}￥</p>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  name: 'detail-modal',
  data () {
    return {
      detailData: {
        userInfo: {},
        completeInfoVO: {},
        itemVOList: []
      }
    }
  },
  methods: {
    setData (data) {
      data.itemVOList.forEach(item => {
        item.goodsImagePath = this.staticUrl + item.goodsImagePath
      })
      this.detailData = data
    }
  },
  created () {
  }
}
</script>

<style scoped>
  .info{
    overflow: hidden;
    width: 500px;
    border-top: 1px solid #dddee1;
  }
  .info .user{
    float: left;
    width: 130px;
    height: 144px;
    border-bottom: 1px solid #dddee1;
    border-right: 1px solid #dddee1;
    text-align: center;
  }
  .info .shipping{
    float: left;
    width: 370px;
  }
  .shipping li{
    height: 36px;
    line-height: 36px;
    padding-left: 10px;
    box-sizing: border-box;
    border-bottom: 1px solid #dddee1;
  }
  .remark{
    height: 70px;
    width: 500px;
    padding-top: 10px;
    border-bottom: 1px solid #dddee1;
  }
  .items{
    width: 500px;
    margin-top: 10px;
  }
  .items li{
    border-bottom: 1px solid #dddee1;
    overflow: hidden;
  }
  .items .goods_img{
    width: 100px;
    height: 100px;
    float: left;
  }
  .items .goods_info{
    float: left;
    margin-left: 8px;
    width: 370px;
  }
  .goods_info li{
    height: 33px;
    line-height: 33px;
  }
  .count p{
    text-align: right;
    height: 26px;
    line-height: 26px;
  }
</style>
